<template>
  <div v-for="(item, index) in todos" :key="index">
  id：{{ item.id }} - name：{{ item.name }} - 状态：{{ item.completed }}
  </div>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'
import { useStore } from 'vuex'
import { key } from '../store'

export default defineComponent({
  name: '',
  setup () {
    const store = useStore(key)
    const todos = computed(() => store.state.todos?.todos)
    return {
      todos
    }
  }
})
</script>

<style lang="scss" scoped>

</style>